﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Pulog.Controllers.AboutFormViewModel>" %>

<asp:Content ID="aboutHead" ContentPlaceHolderID="head" runat="server">
    <title>About Me</title>
    <script type="text/javascript">
        $(function() {
            $('#getContactLink').click(function(){
                $('#contactDiv').slideToggle();
            });
            $('#btnGetContact').click(function(){
                var c = "answer="+$('#answer').attr('value');
                $.ajax({
                    type: "POST",
                    data: c,
                    dataType: "text/xml",
                    url: "<%=ResolveUrl("~/Home/GetContact/") %>",
                    success: function(response,textStatus){
                        $("#contactDiv").html(response);
                    },
                    eror: function(XMLHttpRequest, textStatus, errorThrown) {
                        alert(textStatus);
                    },
                    complete: function(XMLHttpRequest, textStatus){
                        
                    }
                });
            });
            
            $().ajaxSend(function(r,s){  
                $("#btnGetContact").attr("disabled", "true");
                $("#btnGetContact").attr("value", "Querying...");
            });
            $().ajaxStop(function(r,s){  
                $("#btnGetContact").removeAttr("disabled");
                $("#btnGetContact").attr("value", "Get");
            });
        })
    </script>
</asp:Content>

<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <div id="pageContent">
        <h3>About</h3>
        <p>
            姓名: Shawn Jiang<br /><br />
            职业: .Net Developer + 兼职学生<br /><br />
            目前居住地：Auckland, New Zealand<br /><br /><br />
            关注互联网发展以及程序设计。<br /><br />
            
            Click <a id="getContactLink" href="javascript:void(0)">here</a> to get my contact details.
        </p>
        
        <div id="contactDiv" style="display:none">
            Please do a simple math: <%=ViewData.Model.x %> + <%=ViewData.Model.y %> = <input type="text" id="answer" /> 
            <input type="button" id="btnGetContact" value="Get" />
        </div>
    </div>
</asp:Content>
